# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=packet-o-matic
pkgver=1394.a1a8ce8
pkgrel=2
epoch=1
pkgdesc='A real time packet processor. Reads the packet from an input module, match the packet using rules and connection tracking information and then send it to a target module.'
arch=('x86_64' 'aarch64')
url='http://www.packet-o-matic.org/'
license=('GPL')
groups=('blackarch' 'blackarch-networking' 'blackarch-tunnel')
depends=('libpcap' 'libxml2' 'libnet' 'uthash' 'libmicrohttpd' 'lua'
         'libexif')
makedepends=('git' 'xmlrpc-c' 'libtool' 'pkg-config')
source=("$pkgname::git+https://github.com/gmsoft-tuxicoman/pom-ng.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  export lua_CFLAGS="-llua"
  export lua_LIBS="-llua"

  autoreconf -f -i
  ./configure --prefix=/usr

  make
}

package() {
  cd $pkgname

  make DESTDIR="$pkgdir" install
}

